<!--
 * @Author: zzy zhangzeyang@huidr.com
 * @Date: 2024-05-20 14:30:07
 * @LastEditors: zzy zhangzeyang@huidr.com
 * @LastEditTime: 2024-05-29 13:04:10
 * @FilePath: \about_vue\src\views\que\que_list.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
// eslint-disable-next-line vue/valid-template-root
<template>
    <div class="page">
        <ActionView title="问卷列表"></ActionView>

        <div v-for="(item, index) in articleArray">
            {{ item.title }}
        </div>


        <div class="rowItemView">
            <div style="width:100px">姓名</div>
            <div style="flex:1">
                <el-input placeholder="输入姓名" v-model="info.name" maxlength="10" type="text"></el-input>
            </div>
        </div>

        <div class="rowItemView">
            <div style="width:100px">性别</div>
            <div style="flex:1">
                <!-- <el-input placeholder="输入姓名"></el-input> -->
            </div>
        </div>

        <div class="rowItemView">
            <div style="width:100px">出生日期</div>
            <div style="flex:1;">
                <el-date-picker v-model="info.brithday" style="width:100%;height:100%">

                </el-date-picker>
            </div>
        </div>

        <div class="rowItemView">
            <div style="width:100px">本人联系方式</div>
            <div style="flex:1">
                <el-input placeholder="请输入本人联系方式" v-model="info.phone1" type="number" maxlength="11"></el-input>
            </div>
        </div>

        <div class="rowItemView">
            <div style="width:100px">家属联系方式</div>
            <div style="flex:1">
                <el-input placeholder="请家属联系方式1"  type="number" maxLength="11"
                    @change="handleChange" @input="inputValue"></el-input>
            </div>

        </div>

     

        <div class="rowItemView">
            <div style="width:100px">紧急联系方式</div>
            <div style="flex:1">
                <el-input placeholder="请输入紧急联系方式" v-model="info.phone3" type="number" maxlength="11"></el-input>
            </div>
        </div>









        <div>
            保存
        </div>

        <div>
            删除
        </div>

        <div>

        </div>





    </div>
</template>

<script>

import ActionView from '../../components/ActionView.vue'
import { jwt } from '../../config.js';
import axios from 'axios'
let that = null;
export default {
    components: { ActionView },
    data() {
        return {
            resultInfo: "hello",
            articleArray: [],
            info: {
                name: "",
                sex: 1,
                brithday: "",
                phone1: "",
                phone2: "",
                phone3: ""
            }
        }
    },

    created() {
        that = this;
        this.queryQueList();
    },
    methods: {

        handleChange(e) {
            console.log(e)
        },

        inputValue(e) {
            
           if(e.length<=11){
            console.log("------------->", e,e.length)
            this.info.value2=e
           }

        },

        selectDate(e) {
            console.log(e)
        },



        queryQueList() {

            // const http = axios.create({
            //     baseURL: 'https://gateway.huidr.com', // 设置基础 URL
            //     // 其他配置...
            //     headers: {
            //         "Content-Type": "application/json",
            //         "jwt":jwt
            //     }
            // });
            // // articleController/queryArticlesList
            // http.post('/community/hcbQuestionnaire/getMoreQuestionnaireList').then(function (res) {
            // // http.post('/community/articleController/queryArticlesList').then(function (res) {
            //     console.log("success  ", res);
            //     that.articleArray = res.data.retValue;
            // }).catch(function (error) {
            //     console.log("error  ", error);
            // }).finally(function () {

            // })

            // axios.defaults.headers.post["Content-Type"]="application/json";
            // axios.defaults.headers.post["jwt"]=jwt

            // url:"/api/community/hcbQuestionnaire/getMoreQuestionnaireList",

            // axios({
            //     method:"POST",
            //     url:"http://gateway-test.huidr.com/community/articleController/queryArticlesList"
            //     // url:"http://gateway-test.huidr.com/community/hcbQuestionnaire/getMoreQuestionnaireList"
            // }).then(function(res){
            //     console.log("success   ",res);
            //     that.articleArray=res.data.retValue;
            // }).catch(function(error){
            //     console.log("error   ",JSON.stringify(error));
            // })

            // axios.post("http://gateway-test.huidr.com/community/hcbQuestionnaire/getMoreQuestionnaireList").then(function(res){
            //     console.log("success   ",res);
            //     that.articleArray=res.data.retValue;
            // }).catch(function(error){
            //     console.log("error   ",JSON.stringify(error));
            // })

            axios({
                method: "post",
                url: "/api/community/hcbQuestionnaire/getMoreQuestionnaireList",
                headers: {
                    'Access-Control-Allow-Origin': '*',
                    'jwt': "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNDE1MjciLCJleHAiOjE3MTc0Nzk0MjIsImlhdCI6MTcxNjg3NDYyMiwiQWNjb3VudEluZm8iOnsiaWQiOjE0MTUyNywibW9iaWxlIjoiMTc2MzU2NjM5OTgiLCJ1c2VyVHlwZSI6MSwiaW1QYXNzd29yZCI6InYxczAxdjIxTmciLCJpc1NldExvZ2luUGFzc3dvcmQiOnRydWUsIm9zTmFtZSI6IkFuZHJvaWQiLCJsYXN0TG9naW5UaW1lIjoiMjAyNC0wNS0yOCAxMzozNzowMiIsInZlcnNpb24iOiIxIiwidXNlclJvbGUiOlsiUk9MRV9QQVRJRU5UIl0sImlzRW5hYmxlIjpmYWxzZSwiYWRkVGltZSI6IjIwMjQtMDQtMjQgMTY6MTg6MjEifX0.94cvvEVrWnFX7WYMTruAvhG3Uxoyv7SjNaZMKraa7Rk"
                }
                // url:"http://gateway-test.huidr.com/community/articleController/queryArticlesList"
            }).then(function (res) {
                console.log("----", res);
            }).catch(function (error) {
                console.log("----", error);
            })
        }
    }
}

</script>


<style>
page {
    width: 100%;
    height: 100%;
    background-color: rebeccapurple;
}

.page {
    width: 100%;
    height: 100%;
}

.rowItemView {
    display: flex;
    align-items: center;
    margin-left: 1em;
    margin-right: 1em;

    height: 40px;
    padding-left: 10px;
    padding-right: 10px;
}
</style>